package com.waya.arraylist;

import java.util.ArrayList;

public class ArrayListDemo4 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("joke");
        arrayList.add("rose");
        System.out.println(arrayList);
        printArrayList(arrayList);
    }
    public static void printArrayList(ArrayList<String> list){
        System.out.print("{");
        for(int i = 0 ; i < list.size(); i++){
            String name = list.get(i);
            if (i == list.size() - 1){
                System.out.print(name + "}");
            }else{
                System.out.print(name + "@");
            }


        }
    }
}
